package cn.zhf.shop.service.impl;

import cn.zhf.shop.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import cn.zhf.shop.mapper.AccountDealMapper;
import cn.zhf.shop.entity.AccountDeal;
import cn.zhf.shop.service.AccountDealService;

@Service
public class AccountDealServiceImpl implements AccountDealService {

    @Resource
    private AccountDealMapper accountDealMapper;

    @Override
    public Message deleteByPrimaryKey(Integer accountDealId) {
        return accountDealMapper.deleteByPrimaryKey(accountDealId) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insertSelective(AccountDeal record) {
        return accountDealMapper.insertSelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer accountDealId) {
        return Message.success(null).add(accountDealMapper.selectByPrimaryKey(accountDealId));
    }

    @Override
    public Message updateByPrimaryKeySelective(AccountDeal record) {
        return accountDealMapper.updateByPrimaryKeySelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message batchInsertSelective(List<AccountDeal> list) {
        System.out.println(list);
        return accountDealMapper.batchInsertSelective(list) > 0 ? Message.success(null) : Message.fail(null);
    }


    @Override
    public Message updateBatchSelective(List<AccountDeal> list) {
        return accountDealMapper.updateBatchSelective(list) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message<List<AccountDeal>> selectAll() {
        return Message.success(null).add(accountDealMapper.selectAll());
    }

    @Override
    public int batchInsert(List<AccountDeal> list) {
        return accountDealMapper.batchInsert(list);
    }

    @Override
    public Message <List<AccountDeal>> selectAllByAccountAccountDealTitleId(String id) {
        return Message.success(null).add(accountDealMapper.selectAllByAccountAccountDealTitleId(id));
    }

    @Override
    public Message<List<AccountDeal>> selectByMerorderno(String id) {
        return Message.success(null).add(accountDealMapper.selectByMerorderno(id));
    }
}






